###############################################                                     
# Cause of Effect? Turnout in Hispanic Majority-Minority Districts
#  - John A. Henderson, Jasjeet S. Sekhon, and Rocio Titiunik
#  - Forthcoming in Political Analysis
#  - Set function headers for replication code
#  - April 14, 2016
###############################################  
                               
is.installed <- function(mypkg){
  is.element(mypkg, installed.packages()[,1])
}   

if (!is.installed("foreign")){
  install.packages("foreign")
}   
if (!is.installed("sandwich")){
  install.packages("sandwich")
}   
if (!is.installed("plyr")){
  install.packages("plyr")
} 
if (!is.installed("Matching")){
  install.packages("Matching")
}                           
if (!is.installed("stringr")){
  install.packages("stringr")
}     
if (!is.installed("snow")){
  install.packages("snow")
}                                               
if (!is.installed("RSQLite")){
  install.packages("RSQLite")
} 
if (!is.installed("xtable")){
  install.packages("xtable")
}
if (!is.installed("exactRankTests")){
  install.packages("exactRankTests")
}

library(foreign)
library(sandwich)
library(plyr)     
library(Matching)
library(stringr)                       
library(snow)
library(RSQLite)
library(xtable)
library(exactRankTests)

source(paste(path,'replicationPA/funs/sandwich.R',sep=''))    
           
# end